package com.lovo.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.lovo.bean.Sale;
import com.lovo.service.impl.SaleServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * ????? 前端控制器
 * </p>
 *
 * @author lovo
 * @since 2022-09-17
 */
@RestController
@RequestMapping("hd/sale")
public class SaleController {

    @Autowired
    SaleServiceImpl saleService;

    @GetMapping("findAllSale/{PageNo}")
    public IPage<Sale> findAllSale(@PathVariable("PageNo") Integer PageNO) {
        return saleService.findAllSale(PageNO);
    }


    @GetMapping("findAllSaleByUserId/{PageNO}/{userId}")
    public IPage<Sale> findAllSaleByUserId(@PathVariable("PageNO") Integer PageNO,
                                           @PathVariable("userId") Integer userId) {
        return saleService.findAllSaleByUserId(PageNO, userId);
    }

}
